//package org.example.demo.controller.userController;
//
//import io.swagger.annotations.ApiOperation;
//import org.example.demo.common.api.CommonResult;
//import org.example.demo.service.userService.UserHomeService;
//import org.example.mbg.model.Product;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import java.util.List;
//
///**
// * 首页推荐商品
// */
//@Controller
//public class CommandProductController {
//    @Autowired
//    private UserHomeService productService;
//
//    @ApiOperation("随机推选数据库的几条数据")
//    @RequestMapping(value = "/randomShow", method = RequestMethod.GET)
//    @ResponseBody
//    public CommonResult<List<Product>> randomShow() {
//        // 权限验证（推荐系统预留）
//        List<Product> products = productService.randomProductShow();
//        if (products == null || products.isEmpty()) {
//            return CommonResult.failed();
//        }
//        return CommonResult.success(products);
//    }
//
//    @ApiOperation("全部选出推荐")
//    @RequestMapping(value = "/home", method = RequestMethod.GET)
//    @ResponseBody
//    public CommonResult<List<Product>> CommandProduct() {
//
//        return CommonResult.success(productService.commandProduct());
//    }
//
//
//}
